var cursorNormal : Texture2D;
var cursorClick : Texture2D;
var cursorOff : Texture2D;

var mainCamera : GameObject;
private var clickScript : ClickScript;

var clicking : boolean;

function Start() {
	clickScript = mainCamera.gameObject.GetComponent("ClickScript");
    Screen.showCursor = false;
}


function Update() {

	
if (Input.GetMouseButton(0)){
	clicking = true;
	}
else {
	clicking = false;
	}


}

function OnGUI() {
    var mousePos : Vector3 = Input.mousePosition;
    var pos : Rect;
    
     
      
    
    if (!clickScript.canClick){
    pos = Rect(mousePos.x-6,Screen.height - mousePos.y-16,cursorOff.width,cursorOff.height);
    	GUI.Label(pos,cursorOff);
    	}
    else if (clicking){
    	pos = Rect(mousePos.x-6,Screen.height - mousePos.y-16,cursorClick.width,cursorClick.height);
    	GUI.Label(pos,cursorClick);
    }
    else {
    pos = Rect(mousePos.x-6,Screen.height - mousePos.y-16,cursorNormal.width,cursorNormal.height);
    	GUI.Label(pos,cursorNormal);
    	}
    
}